//玩家拥有的装备表
import { MapWrap } from "../../../Core/FrameEx/ES5Ex";
import { GLocal } from "../../../Core/Manager/DataPool";
import { REquireItem } from "../RunTime/RunRaw/RItemAttach";
const { ccclass } = cc._decorator;
@ccclass
export default class LOwnEquips extends GLocal {
    public $localKey = "LOwnEquips";
    private $ownEquips: any[][] = [];

    public onInit() {
        this.load();
        this.set();
    }

    public save(mapData: MapWrap<StringOrNumber, REquireItem>) {
        this.$ownEquips = [];
        mapData.values<REquireItem>().map(value => {
            let equip = [value.insId, value.equipId, value.sLv, value.quality, value.isFirstExp, value.wear]
            this.$ownEquips.push(equip);
        });
        this.set();
    }

    public getAllEquips() {
        return this.$ownEquips;
    }
}